<?php

namespace App\Models;

use App\Traits\ModelEventTrait;
use Illuminate\Database\Eloquent\SoftDeletes;


/**
 * @property int            $group_id
 * @property string         $group_name
 * @property string         $file_type
 * @property \Carbon\Carbon $created_at
 * @property int            $upload_user_id
 * @property string         $upload_user_type
 * @property \Carbon\Carbon $updated_at
 * @property string         $deleted_at
 */
class UploadFileGroup extends Model
{
    use ModelEventTrait;
    use SoftDeletes;

    const KEY = 'group_id';
    const TABLE = 'sp_upload_file_group';

    protected $table = self::TABLE;
    protected $primaryKey = self::KEY;
    protected $connection = 'mysql';

    const CREATED_AT = 'create_time';
    const UPDATED_AT = 'update_time';
    const DELETED_AT = 'delete_time';

    protected $guarded = [];

    protected $hidden = [
        self::DELETED_AT,
    ];

    protected $casts = [
        'group_id' => 'integer',
        'create_time' => 'datetime:Y-m-d H:i:s',
        'update_time' => 'datetime:Y-m-d H:i:s',
    ];

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected array $fillable = ['group_name', 'file_type', 'upload_user_id', 'upload_user_type'];


}
